<%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/4/22
  Time: 21:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<%
    String path =request.getContextPath();
%>
<body  style="background-image:url('image/9103.jpg'); background-size: 1700px 1000px">
<script src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">

    function fun(){
        var name1 = $("#username1").val();
        $.ajax({
            url:"xiugai",
            type:"get",
            data:{
                username:name1,
            },
            dataType:"text",

            success:function (data) {
                if (data==1){
                    var path=document.getElementById("path").value;
                    window.location.href=path+"/success.jsp"
                }else {
                    alert("用户名不存在")
                }
            },
            error:function (data) {
                alert("用户名不存在")

            }
        })
    }

</script>
<div style="margin-left: 500px;margin-top: 200px ;line-height: 55px;border: 1px solid yellow;background-color: white;width: 600px; opacity: 0.8;height: 270px">
    <div style="width: 30% ;margin: 0px auto">
        <strong style="font-size: 40px">美食天下</strong>
    </div>

    <form  method="get" style="width: 45% ;margin: 0px auto">
        <label style="position: absolute;left: 565px;font-size: 25px;position: absolute;top: 263px">用户名*</label>
        <input type="text" id="username1" value=""  size="46" style="height: 30px; line-height: 50px;position: absolute;left: 685px;top: 278px"><br>
        <input type="hidden" id="path" value="<%=path%> "style="margin-left: 60px">

    </form>
    <input type="submit" onclick="fun()" value="下一步" style="margin-left: 120px ;background-color: red;color: white;border-color: red;width: 100px;height: 35px;position: absolute;right:523px;top: 350px"/>
    <span style="position: absolute;left: 600px ;top:430px">如有疑问，请发送邮件联系客服 help@meishichina.com</span>
</div>

</body>
</html>
